package cn.middle.application.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.middle.common.base.mapper.BaseMapper;
import com.middle.common.base.service.impl.BaseServiceImpl;
import com.middle.common.result.Page;

import cn.middle.application.entity.EdgeService;
import cn.middle.application.mapper.EdgeServiceMapper;
import cn.middle.application.service.EdgeServiceService;


@Service
public class EdgeServiceServiceImpl extends BaseServiceImpl<EdgeService> implements EdgeServiceService {

	@Autowired
	private EdgeServiceMapper mapper;
	@Override
	public BaseMapper<EdgeService> getDao() {
		return mapper;
	}
	@Override
	public Page<EdgeService> listConditions(int page, int pageSize, String serviceId, String serviceName, Byte status) {
		PageHelper.startPage(page,pageSize);
		List<EdgeService> services = mapper.listConditions(serviceId, serviceName, status);
		return new Page<>(new PageInfo<>(services));
	}
	@Override
	public List<EdgeService> findByParkId(String parkCode) {
		return mapper.listByParkCode(parkCode);
	}
	@Override
	public EdgeService byServiceId(String serviceId) {
		return mapper.byServiceId(serviceId);
	}

}
